﻿@model CatalogPagingFilteringModel
<div class="product-selectors">
    @*view mode*@
    @if (Model.AllowProductViewModeChanging)
    {
        <div class="product-viewmode">
            <span>@T("Catalog.ViewMode")</span>
            @if (Model.AvailableViewModes.Count > 1)
            {
                var gridMode = Model.AvailableViewModes[0];
                var listMode = Model.AvailableViewModes[1];

                <a class="viewmode-icon grid @if(gridMode.Selected){<text>selected</text>}" href="@gridMode.Value" title="@gridMode.Text">@gridMode.Text</a>
                <a class="viewmode-icon list @if (listMode.Selected){<text>selected</text>}" href="@listMode.Value" title="@listMode.Text">@listMode.Text</a>
            }
        </div>
    }
    @*sorting*@
    @if (Model.AllowProductSorting)
    {
        <div class="product-sorting">
            <span>@T("Catalog.OrderBy")</span>
            @Html.DropDownList("products-orderby", Model.AvailableSortOptions, new { onchange = "setLocation(this.value);", aria_label = T("Catalog.OrderBy.Label") })
        </div>
    }
    @*page size*@
    @if (Model.AllowCustomersToSelectPageSize)
    {
        <div class="product-page-size">
            <span>@T("Catalog.PageSize")</span>
            @Html.DropDownList("products-pagesize", Model.PageSizeOptions, new { onchange = "setLocation(this.value);", aria_label = T("Catalog.PageSize.Label") })
            <span>@T("Catalog.PageSize.PerPage")</span>
        </div>
    }
</div>